package ar.com.e2solver.solver;



public class GAResult implements SolverResult {

	private Population finalPopulation;
	private long algorithmDuration;
	private int numberOfIterations;
	private Individual best;
	
	public GAResult(Population finalPopulation, long milisecs, int iteration, Individual best){
		this.finalPopulation = finalPopulation;
		this.algorithmDuration = milisecs;
		this.numberOfIterations = iteration;
		this.best = best;
	}

	public Individual getBestIndividual(){
		return best;
	}
	
	public Population getFinalPopulation(){
		return this.finalPopulation;
	}
	
	public double getPopulationES(){
		return this.finalPopulation.getES();
	}
	
	public double getPopulationVS(){
		return this.finalPopulation.getVS();
	}
	
	public long getAlgorithmDuration(){
		return this.algorithmDuration;
	}
	
	public int getMaxPossibleFitness(){
		return this.getBestIndividual().getMaxPossibleFitness();
	}

	public int getNumberOfIterations() {
		return numberOfIterations;
	}

	public void setNumberOfIterations(int numberOfIterations) {
		this.numberOfIterations = numberOfIterations;
	}
}
